import request from "@/utils/request";

// 获得题库列表
export const questionList = (params) => {
  return request({
    url: "/question/list",
    params,
  });
};

// 修改题目的状态
export const questionStatus = (id) => {
  return request({
    url: "/question/status",
    method: "post",
    data: {
      id,
    },
  });
};

// 文件上传的接口
export const questionupload = (data) => {
  return request({
    url: "/question/upload",
    method: "post",
    data: data,
  });
};

// 新增题目的接口
export const questionAdd = (data) => {
  return request({
    url: "/question/add",
    method: "post",
    data,
  });
};

// 编辑题目的方法
export const questionEdit = (data) => {
  return request({
    url: "/question/edit",
    method: "post",
    data,
  });
};

// 删除题目的方法
export const questionRemove = (id) => {
  return request({
    url: "/question/remove",
    method: "post",
    data: {
      id,
    },
  });
};

// 获得学科的列表
export const subjectList = () => {
  return request({
    url: "/subject/list",
  });
};

// 获得企业的接口
export const enterpriseList = () => {
  return request({
    url: "/enterprise/list",
  });
};

// 获得题目的详情信息
export const questionOne = (id) => {
  return request({
    url: "/question/one",
    method: "post",
    data: {
      id,
    },
  });
};
